import java.util.Scanner;
public class Year {
    public static void main(String[] args) {
        char length = 0;
        Scanner sc;
        do {
            if (length == 0) {
                System.out.println("请输入你要输入的年份数字:");
                // 定义一个年份的变量
            } else {
                System.out.println("请重新输入四位数年份：");
            }
            sc = new Scanner(System.in);
            String id = sc.next();
            length = (char) id.length();
        } while (length != 4);
        System.out.println("请再次输入刚刚的四位数年份：");
        int year = sc.nextInt();
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            System.out.println("结果为:" + year + "是闰年");
        } else {
            System.out.println("结果为:" + year + "是平年");
        }
    }}